<?php
    class UsersAction extends SCAction{
	  public function doadd(){
	    $this->D_add('Users');
	  }
	  public function mif($name,$id){
	    $this->id=$id;
	    $this->name=$name;
		$this->display();
	  }
	  
	  public function domif(){
       $this->D_update('Users');
	  }
	  public function deluser($name){
    $Form   =   M('Users');
    $where['username']=$name;  
    if($Form->where($where)->delete()) {
        $this->success('删除'.$name.'成功');// 模板变量赋值
    }else{
        $this->error('数据错误');
    }
	  } 
	  public function ulist(){
	     $users=M('users');
		 $data=$users->select();
		 $this->data=$data;
		 $this->display();
	  }
	}
?>
